module.exports = {
  assetsDir: 'static',
  productionSourceMap: false,
  css: {
    sourceMap: process.env.NODE_ENV === 'development'
  },
  configureWebpack: {
    devtool: 'source-map'
  },
  outputDir: process.env.outputDir,
  configureWebpack: config => {
    if (process.env.VUE_APP_MODE === 'test') {
      // 设置测试环境的publicPath为空字符串，使得资源文件引用时不包含任何路径
      config.output.publicPath = './static/js';
    }
  },
  devServer: {
    proxy: {
      '/api_kz':{
        target:process.env.VUE_APP_BASE_URL_KZ+'/index.php',
        changeOrigin:true,
        pathRewrite:{
          '/api_kz': '/'
        },
      },
      '/api':{
        target:process.env.VUE_APP_BASE_URL+'/index.php/admin',
        changeOrigin:true,
        pathRewrite:{
          '/api': '/'
        },
      },
    }
  }
}